/*
 * @Author: 徐伟杰/Hyuishine
 * @Date: 2022/5/19
 * @LastEditors: 徐伟杰
 * @LastEditTime: 2022-12-14 10:43:13
 * @Description:
 * @Email: 1529315455@qq.com
 * @Company: 3xData
 * @youWant: add you want
 */
import globalPostRequest from "@/request/globalPostRequest.js";

// 项目列表查询
export function getTaskListApi(data, callback) {
  return globalPostRequest({
    url: "/project/pageList",
    method: "get",
    data,
    callback,
  });
}

// 首页项目列表查询
export function getHomeTaskListApi(data, callback) {
  return globalPostRequest({
    url: "/project/getProjectList",
    method: "get",
    data,
    callback,
  });
}

// 项目负责人-技术负责人-执业人员列表查询
export function getLeaderListApi(data, callback) {
  return globalPostRequest({
    url: "/staff/pageList",
    method: "get",
    data,
    callback,
  });
}

// 项目负责人-技术负责人-执业人员(包括离职)列表查询
export function getLeaderDepListApi(data, callback) {
  return globalPostRequest({
    url: "/staff/listAllStaff",
    method: "get",
    data,
    callback,
  });
}
// 项目负责人-技术负责人-执业人员(包括离职)列表查询
export function getLeaderDepListApiList(data, callback) {
  return globalPostRequest({
    url: "/staff/listStaffByAll",
    method: "get",
    data,
    callback,
  });
}
// 项目负责人-技术负责人-执业人员(包括离职)三合一列表查询
export function getListStaffByAllApi(data, callback) {
  return globalPostRequest({
    url: "/staff/listStaffByAll",
    method: "get",
    data,
    callback,
  })
}
// 获取维保列表
export function wbList(projectId, callback) {
  return globalPostRequest({
    url: "/project/getWBList/" + projectId,
    method: "get",
    callback,
  });
}

// 获取维保执行人员列表
export function wbPeopleList(data, callback) {
  return globalPostRequest({
    url: "/staff/listAllStaff",
    method: "get",
    data,
    callback,
  });
}
// 项目登记的新增
export function addTaskInfoApi(data, callback) {
  return globalPostRequest({
    url: "/project",
    method: "post",
    data,
    callback,
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
  });
}

// 项目登记的修改
export function updateTaskInfoApi(data, callback) {
  return globalPostRequest({
    url: "/project",
    method: "put",
    data,
    callback,
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
  });
}

// 项目列表点击进入详情页
export function getDetailInfoApi(data, callback) {
  return globalPostRequest({
    url: "/project/" + data,
    method: "get",
    callback,
  });
}

// 查看报告列表
export function report_list(data, callback) {
  return globalPostRequest({
    url: "/rport/getList",
    method: "get",
    data,
    callback,
  });
}

// 查看报告列表
export function getUnauditedListApi(data, callback) {
  return globalPostRequest({
    url: "/rport/approvalList",
    method: "get",
    data,
    callback,
  });
}
// 项目名称列表
export function projectName(data, callback) {
  return globalPostRequest({
    url: "/project/getTreeList?projectName=" + data.projectName,
    method: "post",
    callback,
  });
}

// 修改项目定位
export function updateLonLat(data, callback) {
  return globalPostRequest({
    url: "/project/updateLonLat",
    method: "put",
    data,
    callback,
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
  });
}
// 检验项目
export function checkProject(data, callback) {
  return globalPostRequest({
    url: "/agencyInfo/checkState",
    method: "get",
    data,
    callback,
  });
}

// 添加单位人员
export function addInfo(data, callback) {
  return globalPostRequest({
    url: "/staff/save",
    method: "post",
    timeout: 60 * 1000,
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    data,
    callback,
  });
}

// 注册时的区域树
export function getAreaTree(data, callback) {
  return globalPostRequest({
    url: "/modules/area/tree",
    method: "get",
    data,
    callback,
  });
}
